{{ header }}
<div class="site-breadcrumb">
  <div class="container">
    <ul class="breadcrumb">
      {% for breadcrumb in breadcrumbs %}
      <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
      {% endfor %}
    </ul>
  </div>
</div>
<div class="page-main user-center">
  <div class="container">
    <div class="row">
      {{ column_left }}
      {% if column_left and column_right %}
      {% set class = 'col-sm-6' %}
      {% elseif column_left or column_right %}
      {% set class = 'col-sm-9' %}
      {% else %}
      {% set class = 'col-sm-12' %}
      {% endif %}
      <div id="content" class="{{ class }}">
        {% if success %}
        <div class="alert alert-success alert-dismissible"><i class="icon-checkmark"></i> {{ success }}
          <button type="button" class="close" data-dismiss="alert">&times;</button>
        </div>
        {% endif %}
        {% if error_warning %}
        <div class="alert alert-danger alert-dismissible"><i class="icon-warning"></i> {{ error_warning }}
          <button type="button" class="close" data-dismiss="alert">&times;</button>
        </div>
        {% endif %}
        {{ content_top }}
        <h1 class="heading">{{ heading_title }}</h1>
        <table class="table table-bordered table-hover">
          <thead>
            <tr>
              <th colspan="2">{{ text_order_detail }}</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td style="width: 50%;">{% if invoice_no %} <b>{{ text_invoice_no }}</b> {{ invoice_no }}<br />
                {% endif %} <b>{{ text_order_id }}</b> #{{ order_id }}<br />
                <b>{{ text_date_added }}</b> {{ date_added }}</td>
              <td style="width: 50%;">
                {% if payment_method %}
                  <b>{{ text_payment_method }}</b> {{ payment_method }}<br />
                  {{ payment }}
                {% endif %}
                {% if shipping_method %} <b>{{ text_shipping_method }}</b> {{ shipping_method }} {% endif %}</td>
            </tr>
          </tbody>
        </table>
        {% if payment_address or shipping_address %}
        <table class="table table-bordered table-hover">
          <thead>
            <tr>
              {% if payment_address %}<td style="width: 50%; vertical-align: top;">{{ text_payment_address }}</td>{% endif %}
              {% if shipping_address %}<td style="width: 50%; vertical-align: top;">{{ text_shipping_address }}</td>{% endif %}
            </tr>
          </thead>
          <tbody>
            <tr>
              {% if payment_address %}
              <td>{{ payment_fullname }}<br/>{{ payment_telephone }}<br/>{{ payment_address }}<br/>{{ payment_postcode }}</td>
              {% endif %}
              {% if shipping_address %}
              <td>{{ shipping_fullname }}<br/>{{ shipping_telephone }}<br/>{{ shipping_address }}<br/>{{ shipping_postcode }}</td>
              {% endif %}
            </tr>
          </tbody>
        </table>
        {% endif %}
        <div class="table-responsive cart-form small">
          <table class="table table-bordered table-hover">
            <thead>
              <tr>
                <th class="col-image">{{ column_image }}</th>
                <th class="col-name">{{ column_name }}</th>
                <th class="col-model">{{ column_model }}</th>
                <th class="col-price">{{ column_price }}</th>
                <th class="col-quantity">{{ column_quantity }}</th>
                <th class="col-subtotal">{{ column_subtotal }}</th>
                {% if products %}<th class="col-action">{{ column_action }}</th>{% endif %}
              </tr>
            </thead>
            <tbody>
              {% for product in products %}
              <tr>
                <td class="col-image">{% if product.thumb %} <a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" /></a> {% endif %}</td>
                <td class="col-name">
                  <a href="{{ product.href }}" class="name">{{ product.name }}</a>
                  {% if product.option %}
                  {% for option in product.option %} <br />
                  <small>{{ option.name }}: {{ option.value }}</small> {% endfor %}
                  {% endif %}
                  {% if product.reward %} <br /><small>{{ product.reward }}</small>{% endif %}
                  {% if product.recurring %} <br /><span class="label label-info">{{ text_recurring_item }}</span> <small>{{ product.recurring }}</small> {% endif %}
                </td>
                <td class="col-model">{{ product.model }}</td>
                <td class="col-price">{{ product.price }}</td>
                <td class="col-quantity">
                  {{ product.quantity }}
                </td>
                <td class="col-subtotal">{{ product.total }}</td>
                {% if products %}
                <td class="col-action">
                  {% if product.reorder %}
                  <a href="{{ product.reorder }}" data-toggle="tooltip" title="{{ button_reorder }}" class="btn btn-default"><i class="icon-cart"></i></a>
                  {% endif %}
                  <a href="{{ product.return }}" data-toggle="tooltip" title="{{ button_return }}" class="btn btn-default"><i class="icon-return"></i></a>
                </td>
                {% endif %}
              </tr>
              {% endfor %}
              {% for voucher in vouchers %}
              <tr>
                <td class="col-image"></td>
                <td class="col-name">{{ voucher.description }}</td>
                <td class="col-model"></td>
                <td class="col-price">{{ voucher.amount }}</td>
                <td class="col-quantity">
                  1
                </td>
                <td class="col-subtotal">{{ voucher.amount }}</td>
                {% if products %}<td class="col-action"></td>{% endif %}
              </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
        <div class="row">
          <div class="col-sm-6">
            <div class="panel-group cart-modules" id="accordion">
              <div class="panel panel-default">
                <div class="panel-heading">
                  <h4 class="panel-title">{{ text_comment }}</h4>
                </div>
                <div id="collapse-comment" class="panel-collapse collapse in">
                  <div class="panel-body">
                    {% if comment %}{{ comment }}{% else %}{{ text_none }}{% endif %}
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-sm-6">
            <table class="table table-borderless total-table">
              {% for total in totals %}
              <tr{% if total.code == 'total' %} class="total-price"{% endif %}>
                <td class="col-title">{{ total.title }}{{ colon }}</td>
                <td class="col-price">{{ total.text }}</td>
              </tr>
              {% endfor %}
            </table>
          </div>
        </div>

        {% if histories %}
        <h3>{{ text_history }}</h3>
        <table class="table table-bordered table-hover">
          <thead>
            <tr>
              <th>{{ column_date_added }}</th>
              <th>{{ column_status }}</th>
              <th>{{ column_comment }}</th>
            </tr>
          </thead>
          <tbody>
          
          {% if histories %}
          {% for history in histories %}
          <tr>
            <td>{{ history.date_added }}</td>
            <td>{{ history.status }}</td>
            <td>{{ history.comment }}</td>
          </tr>
          {% endfor %}
          {% else %}
          <tr>
            <td colspan="3" class="text-center">{{ text_no_results }}</td>
          </tr>
          {% endif %}
            </tbody>
          
        </table>
        {% endif %}
        <div class="buttons clearfix">
          <div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
        </div>
        {{ content_bottom }}
      </div>
      {{ column_right }}
    </div>
  </div>
</div>
{{ footer }}